package com.wzy.netty.core.inboundhandlerandoutboundhandler;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * 描述 3
 * 创建人    Wzy
 * 创建时间: 2020-05-22  21:06
 */
public class MyClientInitializr extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();
        //出栈 加入出栈handler 对数据编码
        pipeline.addLast(new MyLongToByteEncoder());
        pipeline.addLast(new MyByteToLongDecoder2());
        //  pipeline.addLast(new MyByteToLongDecoder());//入站解码
        //加入处理业务逻辑handler
        pipeline.addLast(new MyClientHandler());

    }
}
